From: Pino Toscano Date: Wed, 19 Aug 2020 17:40:32 +0000 (+0100) Subject: Avoid unconditional PATH_MAX usage X-Git-Tag: archive/raspbian/5.14.2+dfsg-6+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f4d440bfdeeb5bb3b5df5bf35ffbe7affebecfb4;p=qtbase-opensource-src.git Avoid unconditional PATH_MAX usage Forwarded: no Last-Update: 2020-04-19 Use a "safe" size in case PATH_MAX is not defined; in the end, this should not be used, as a allocating realpath() will be used instead. Gbp-Pq: Name path_max.diff --- diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index c224770f1..d7e05d190 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -684,7 +684,11 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, Q_UNUSED(data); return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath())); #else +#ifdef PATH_MAX char stack_result[PATH_MAX+1]; +#else + char stack_result[4096+1]; +#endif char *resolved_name = nullptr; # if defined(Q_OS_DARWIN) || defined(Q_OS_ANDROID) // On some Android and macOS versions, realpath() will return a path even if